package com.shiwaixiangcun.customer.entity

import android.os.Parcel
import android.os.Parcelable
import com.google.gson.annotations.SerializedName


/**
 * 通用List返回
 */
data class CommonListCallBack<out T>(
        @SerializedName("data") val data: List<T>,
        @SerializedName("success") val success: Boolean, //true
        @SerializedName("message") val message: String, //操作成功
        @SerializedName("responseCode") val responseCode: Int //1001
)


/**
 * 通用对象返回
 */
data class CommonObjCallBack<out T>(
        val data: T,

        val success: Boolean, //true
        val message: String, //操作成功
        val responseCode: Int //1001
)


data class Data(
        val totalAmount: Int, //28
        val size: Int, //5
        val elements: List<Element>,
        val totalPages: Int, //6
        val page: Int //1
)

data class TicketInvalid(
        val totalAmount: Int, //28
        val size: Int, //5
        val elements: List<MyTicketInfo>,
        val totalPages: Int, //6
        val page: Int //1
)

data class Element(
        val date: String, //2017-12-13 (Wed)
        val midwayLines: List<MidwayLine>
)

data class MidwayLine(
        val endSiteName: String, //的撒范德萨发z
        val goTime: String, //07:00 发车
        val midwayLineId: Long, //3
        val recordId: Long, //171
        val remainTicket: Long, //50
        val startSiteName: String, //车站
        val price: Float,
        val time: String, //约1.5小时到达
        val totalTicket: Long //50
)


/**
 * 车票详情
 */
data class TicketDetail(
        @SerializedName("endSite") val endSite: String, //地方
        @SerializedName("endSiteImages") val endSiteImages: List<SiteInfo>,
        @SerializedName("startSiteImages") val startSiteImages: List<SiteInfo>,
        @SerializedName("startLocation") val startLocation: String, //dsfdsf
        @SerializedName("price") val price: Float, //70
        @SerializedName("remainTicket") val remainTicket: Int, //20
        @SerializedName("midWayId") val midWayId: String, //4
        @SerializedName("survey") val survey: String, //全程约150.0公里，约2.0小时抵达
        @SerializedName("rideTime") val rideTime: Long, //1513130400000
        @SerializedName("id") val id: String, //88
        @SerializedName("startSite") val startSite: String, //车站
        @SerializedName("endLocation") val endLocation: String //333
)

/**
 * 站点的信息(包括图片)
 */

data class SiteInfo(
        @SerializedName("path") val path: String, //http://resource.shiwaixiangcun.cn/group1/M00/01/8A/rBKx51owlQqAMgSeAANGduydT94197.jpg
        @SerializedName("address") val address: String//成都东站正门口
)

data class SiteDetail(

        val siteTitle: String,
        val path: String,
        val siteName: String
) : Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readString(),
            parcel.readString())

    override fun writeToParcel(parcel: Parcel, flags: Int) {

        parcel.writeString(siteTitle)
        parcel.writeString(path)
        parcel.writeString(siteName)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<SiteDetail> {
        override fun createFromParcel(parcel: Parcel): SiteDetail {
            return SiteDetail(parcel)
        }

        override fun newArray(size: Int): Array<SiteDetail?> {
            return arrayOfNulls(size)
        }
    }
}


/**
 * 购买车票成功
 */
data class BuyTicketSuccess(
        @SerializedName("number") val number: String
)

/**
 * 车票信息
 */
data class MyTicketInfo(
        @SerializedName("endSite") val endSite: String, //宜宾车站
        @SerializedName("statusCN") val statusCN: String, //待验票
        @SerializedName("orderId") val orderId: String, //708112874950836224
        @SerializedName("rideTime") val rideTime: Long, //1513150200000
        @SerializedName("startSite") val startSite: String, //成都东站
        @SerializedName("status") val status: String //Wait_Check
)


/**
 * 车票订单详情
 */
data class TicketOrderDetail(
        @SerializedName("payWay") val payWay: String,
        @SerializedName("endSiteImages")
        val endSiteImages: List<SiteInfo>,
        @SerializedName("code")
        val code: String, //25946071
        @SerializedName("statusCN")
        val statusCN: String, //待验票
        @SerializedName("totalPrice")
        val totalPrice: Double, //0.03
        @SerializedName("count")
        val count: Int, //3
        @SerializedName("rideTime")
        val rideTime: Long, //1513159200000
        @SerializedName("buyer")
        val buyer: String, //世外生活
        @SerializedName("endSite")
        val endSite: String, //自贡车站
        @SerializedName("startSiteImages")
        val startSiteImages: List<SiteInfo>,
        @SerializedName("orderTime")
        val orderTime: Long, //1513157352672
        @SerializedName("startLocation")
        val startLocation: String, //成都东站正门口，大门处
        @SerializedName("phone")
        val phone: String, //18235468745
        @SerializedName("survey")
        val survey: String, //全程约263.0公里，约4.0小时抵达
        @SerializedName("startSite")
        val startSite: String, //成都东站
        @SerializedName("endLocation")
        val endLocation: String, //车站后门
        @SerializedName("status")
        val status: String, //Wait_Check
        @SerializedName("searNumber")
        val searNumber: List<String>
)


/**
 * 摄像头绑定验证
 */
data class CameraVerification(
        var verification: Boolean
)